﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.DataMining
{
    /// <summary>
    /// This class represents an result item of a Principal Component Analysis.
    /// </summary>
    [Serializable]
    public class PrincipalComponentAnalysisResultItem : IPrincipalComponentAnalysisResultItem
    {
        /// <summary>
        /// The column index of the analysis result item.
        /// </summary>
        private int columnIndex;

        /// <summary>
        /// The eigenvalue of the analysis result item.
        /// </summary>
        private double eigenValue;

        /// <summary>
        /// The total variance of the column.
        /// </summary>
        private double totalVariance;

        /// <summary>
        /// The total cumulative percentage of the column.
        /// </summary>
        private double cumulativePercentage;

        /// <summary>
        /// Initializes a new instance of the <see cref="PrincipalComponentAnalysisResultItem"/> class.
        /// </summary>
        /// <param name="columnIndex">The column index of the analysis result item.</param>
        /// <param name="eigenValue">The eigenvalue of the analysis result item.</param>
        /// <param name="totalVariance">The total variance of the column.</param>
        /// <param name="cumulativePercentage">The total cumulative percentage of the column.</param>
        public PrincipalComponentAnalysisResultItem(int columnIndex, double eigenValue, double totalVariance,
                                                    double cumulativePercentage)
        {
            this.columnIndex = columnIndex;
            this.eigenValue = eigenValue;
            this.totalVariance = totalVariance;
            this.cumulativePercentage = cumulativePercentage;
        }

        /// <summary>
        /// Gets or sets the column index of the analysis result item.
        /// </summary>
        /// <value>The column index of the analysis result item.</value>
        public int ColumnIndex
        {
            get { return columnIndex; }
            set { columnIndex = value; }
        }

        /// <summary>
        /// Gets or sets the eigenvalue of the analysis result item.
        /// </summary>
        /// <value>The eigenvalue of the analysis result item.</value>
        public double EigenValue
        {
            get { return eigenValue; }
            set { eigenValue = value; }
        }

        /// <summary>
        /// Gets or sets the total variance of the column.
        /// </summary>
        /// <value>The total variance of the column.</value>
        public double TotalVariance
        {
            get { return totalVariance; }
            set { totalVariance = value; }
        }

        /// <summary>
        /// Gets or sets the total cumulative percentage of the column.
        /// </summary>
        /// <value>The total cumulative percentage of the column.</value>
        public double CumulativePercentage
        {
            get { return cumulativePercentage; }
            set { cumulativePercentage = value; }
        }
    }
}